<?php
include('rootlogin.php');

//include('../incsession.php');

$level=$_SESSION['admin_level'];
$level_def=array("","EASY", "INTERMEDIATE", "DIFFICULT");
if(!isset($_POST['video_intro'])){
			$flag=0;
}
else if($_POST['video_intro'] == '' || $_POST['video_intro'] == ' '){
			$flag=1;	
}
else{
	$intro = str_replace("'", "&#39;", $_POST['video_intro']);
	$intro = str_replace('"', '&quot;', $intro);
	$query = "INSERT INTO abstract (topicid, level, abstract) VALUES (".$_SESSION['topicid'].", ".$level.",'".$intro."')";	
	$result = mysql_query($query,$orcp_con) or die('<font color="#C11B17">Error. Please go back to the previous page and try again.</font>');
	//$result = mysql_query($query,$user_con);
	//echo $query;
	header ("location: abstract_drag_and_drop.php");
}
?>
<head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="framestyle.css" type="text/css" media="screen">
</head>

<body>
<div id="wrapper">
<div id="title">Online Listening Comprehension Program</div>

<div id="main">
<hr/>
<div id="title2">FOR <?php echo $level_def[$_SESSION['admin_level']]; ?> LEVEL: INTRO TO THE VIDEO</div>
<hr/>
<br><br>
<?php
	if($flag==1){
		echo "<div id='error'>Please fill in all the column.</div><br>";
	}
?>
<form method = POST action="abstract.php" >


introduction to the article<br>
<textarea name="video_intro" rows=12 cols=110></textarea>

<br><br>
<div class="btn_right"><input type="submit" name = "next" value = "next"></div>

</form>


</div>
</div>

</body>

